package com.atguigu.srb.core.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: WxLoginInfoProperties
 * Package: com.atguigu.srb.core.config
 * Description:
 *
 * @Author 王晓龙
 * @Create 2023/4/3 11:18
 * @Version 1.0
 */
@Configuration
@ConfigurationProperties(prefix = "wx.login")
@Data
public class WxLoginInfoProperties implements InitializingBean {
    private String api;
    private String appid;
    private String secret;
    private String redirectUri;
    private String callbackUrl;
    private String userInfoUrl;
    private String redirectUrl;

    public static String API;
    public static String APPID;
    public static String SECRET;
    public static String REDIRECTURI;
    public static String CALLBACKURL;
    public static String USERINFOURL;
    public static String REDIRECTURL;


    @Override
    public void afterPropertiesSet() throws Exception {
        API = this.api;
        APPID = this.appid;
        SECRET = this.secret;
        REDIRECTURI = this.redirectUri;
        CALLBACKURL = this.callbackUrl;
        USERINFOURL = this.userInfoUrl;
        REDIRECTURL = this.redirectUrl;
    }
}
